cmake_minimum_required(VERSION 3.16)

project(kylin-os-manager-config LANGUAGES CXX)

set(SELF_TOP_DIR ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

add_executable(${PROJECT_NAME})

target_compile_options(${PROJECT_NAME} PRIVATE -Wall -g)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)

find_package(Qt5 COMPONENTS Core REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core)

set(SRCS "${SELF_TOP_DIR}/src/main.cpp"
         "${SELF_TOP_DIR}/src/utils.cpp"
         "${SELF_TOP_DIR}/src/utils-config.cpp"
)

target_include_directories(${PROJECT_NAME} PRIVATE ${SELF_TOP_DIR}/src/)
target_sources(${PROJECT_NAME} PRIVATE ${SRCS})

install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
install(FILES ${SELF_TOP_DIR}/data/kylin-os-manager-config.desktop DESTINATION /etc/xdg/autostart)